You could try to recover them with testdisk or photorec (don't be deceived by the latter's name, it can restore countless file types), but the best way to prevent data loss would be backups on a regular basis.
Testdisk and photorec are both part of the same installation package testdisk. Its installation is explained in the first link above.